if __name__=="__main__":
    i=100
    result=[]
    while i<999:
        g=i%10
        s=(i-g)//10%10
        b=(i-s*10-g)//100
        if g*g*g+s*s*s+b*b*b==i:
           result.append(i)
        i+=1
    for each in result:
        print(each)